import { base } from '@/config'
import http from '@/utils/request'

// 供应链
const supplyApi = {
  // 供应链列表
  getSupplyList: () => {
    return http.get(`${base.open}/supply/list`)
  },
  // 供应链下拉列表
  getSelectList: () => {
    return http.get(`${base.open}/supply/list/select`)
  },
  // 供应链开启关闭
  updatedSupplyStatus: (type, id) => {
    return http.post(`${base.open}/supply/${type}/${id}`)
  },
  // 保存供应链配置
  saveSupplyConfig: params => {
    return http.postJson(`${base.open}/supply/config`, params)
  },
  // 获取供应链配置
  getSupplyConfig: id => {
    return http.get(`${base.open}/supply/get/config/${id}`)
  },
  // 商品验证
  valid: params => {
    return http.get(`${base.open}/supply/goods/get`, params)
  }
}

export default supplyApi
